const express = require('express');
let SongCont = require('../model/log')
let router = express.Router();
let string = ''
router.get('/', (req, res) => {
    res.render("index2", { string: "" })
})
router.post('/login', (req, res) => {
    console.log(req.body);
    let { username, password } = req.body;
    if (username === '风吹不过大海' && password === "5201314") {
        let bool = true
        SongCont.find((err, data) => {
            res.render("login", {
                bool,
                data
            })
        })
    } else {
        res.render("index2", { string: "账号密码错误" })
    }

})




module.exports = router;